<?php
$client = stream_socket_client(
    'tcp://127.0.0.1:9001',
    $errno,
    $errStr,
    1,
    STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT
);

$res = fwrite($client, 'Hello Server');

$data = fread($client, 66535);

var_dump($data . PHP_EOL);


sleep(2);

$res = fwrite($client, 'Hello Server');

$data = fread($client, 66535);

var_dump($data . PHP_EOL);


sleep(5);

$res = fwrite($client, 'Hello Server');

$data = fread($client, 66535);

var_dump($data . PHP_EOL);
